﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;

namespace FrameworkQ.DataCopy
{
    public class DataConnectableBase : IConnectable
    {
        protected OleDbConnection _conn = null;

        public bool Connect()
        {
            _conn = new OleDbConnection();
            _conn.ConnectionString = this.ConnectionString;
            _conn.Open();
            return true;
        }

        public string ConnectionString
        {
            get;
            set;
        }

        public bool Disconnect()
        {
            if (_conn != null)
            {
                _conn.Close();
                _conn = null;
            }
            return true;
        }

        IDictionary<string, ColumnDefinition> GetColumns()
        {
            DataTable schemaTable = _conn.GetSchema();
            return null;
        }
    }
}
